﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReturnGoods.aspx.cs" Inherits="lcs.Web.Outstorage.ReturnGoods"
     EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/JsTools.js" type="text/javascript"></script>
     <link href="../Style.css" rel="stylesheet" />
    <link href="../css/myStyle.css" rel="stylesheet" />
    <link href="/style.css" type="text/css" rel="stylesheet" />
    <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         function checksel() {
             if ($("#<%= GridView1.ClientID %> tr :checkbox:checked").length > 0)
                 return true;
             else
             { alert('没有选择任何行！'); return false; }

         }

         $(function () {
             $("#txt_purposeProjectName").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
    </script>
    <style>
        .tdLeft
        {
            text-align: right;
        }
        .tdRight
        {
            text-align: left;
        }
        .style1
        {
            text-align: right;
            height: 25px;
        }
        .style2
        {
            text-align: left;
            height: 25px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
         <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
        <tr>
            <td class="tdbg">
                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                        <td height="25" colspan="2">
                            <b>退库操作</b>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            退库项目名称：
                        </td>
                        <td class="style2">
                            <asp:TextBox ID="txt_projectName" runat="server" Width="200px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" class="tdLeft">
                            退库物料描述：
                        </td>
                        <td height="25" class="tdRight">
                            <asp:TextBox ID="txt_materialinfo" runat="server" Width="200px"></asp:TextBox>
                            <asp:Button ID="btn_sel" runat="server" Text="查询" class="inputbutton"  CssClass="btn" OnClick="btn_sel_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                                BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" 
                                GridLines="None" Width="100%"
                                AllowPaging="True" onpageindexchanging="GridView1_PageIndexChanging" OnRowDataBound="GridView1_RowDataBound">
                                <Columns>
                                    <asp:TemplateField HeaderText="选择">
                                        <HeaderTemplate>
                                            <input id="cbo_checkAll" type="checkbox" onclick="checkall(this)" />全选
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:CheckBox ID="cbo_check" runat="server" />
                                            <asp:Label ID="lbl_mid" runat="server" Text='<%# Bind("mid") %>' 
                                                Visible="False"></asp:Label>
                                            <asp:Label ID="lbl_inid" runat="server" Text='<%# Bind("inid") %>' 
                                                Visible="False"></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="退库数量">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txt_returnCount" runat="server" Width="50px"></asp:TextBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="项目编号">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("proid") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_proid" runat="server" Text='<%# Bind("proid") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="项目名称">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("projectName") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_projectName" runat="server" 
                                                Text='<%# Bind("projectName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="物料描述">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("material") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_material" runat="server" Text='<%# Bind("material") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="单位">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("unit") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_unit" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="入库量">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("innum") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_instoreNums" runat="server" Text='<%# Bind("innum") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="nums" HeaderText="库存量" />
                                </Columns>
                                <PagerStyle CssClass="mypager" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2" style="text-align: left; margin-bottom: 10px; margin-top: 10px;">
                            
                            退库人：<asp:TextBox ID="txt_returnName" runat="server" Width="100px" ></asp:TextBox>
&nbsp;退库时间：<asp:TextBox ID="txt_returnTime" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})" Width="100px"></asp:TextBox>
                            
                            目的项目：<asp:TextBox ID="txt_purposeProjectName" runat="server"  Width="238px"></asp:TextBox>
                            
                            备注：<asp:TextBox ID="txt_remark" runat="server"  Width="200px"></asp:TextBox>
                            
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2" style="text-align: center; margin-bottom: 10px; margin-top: 10px;">
                            <asp:Button ID="btn_addReturn" runat="server" Text="添加" class="inputbutton"  CssClass="btn" OnClick="btn_addReturn_Click" />
                        &nbsp;
                            <asp:Button ID="btn_re" runat="server" Text="重置" class="inputbutton"  CssClass="btn" 
                                OnClick="btn_re_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2" style="text-align: center; margin-bottom: 10px; margin-top: 10px;">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2" style="text-align: center; font-weight: bold; font-size: 18px;
                            margin-bottom: 10px; margin-top: 10px;">
                            退 库 清 单
                        </td>
                    </tr>
                    <tr>
                        <td height="25" colspan="2">
                            <asp:GridView ID="GridView2" runat="server" Width="100%" AutoGenerateColumns="False"
                                BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None">
                                <Columns>
                                    <asp:BoundField DataField="returnCount" HeaderText="退库数量" />
                                    <asp:BoundField DataField="material" HeaderText="物料描述" />
                                    <asp:BoundField DataField="unit" HeaderText="数量单位" />
                                    <asp:BoundField DataField="projectname" HeaderText="项目名称" />
                                    <asp:BoundField DataField="proid" HeaderText="项目编号" />
                                    <asp:BoundField DataField="mid" HeaderText="物料ID" Visible="False" />
                                </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                     <tr>
                        <td height="25" colspan="2" style="text-align: center; margin-bottom: 10px; margin-top: 10px;">
                            <asp:Button ID="btn_submit" runat="server" Text="提交" class="inputbutton"  CssClass="btn" 
                                OnClick="btn_submit_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td height="25" class="tdLeft">
                            &nbsp;
                        </td>
                        <td height="25" class="tdRight">
                            &nbsp;
                        </td>
                    </tr>
                </table>
    </form>
</body>

</html>
   


   

